package utils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

public class Mysql {
    public static ResultSet getrs(String sql){
        Connection conn=null;
        PreparedStatement ps=null;
        ResultSet rs = null;
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            String url="jdbc:mysql:///ok50";
            String user = "root";
            String pwd = "123456";
            conn = DriverManager.getConnection(url,user,pwd);
             ps=conn.prepareStatement(sql);
             rs= ps.executeQuery();

        }catch (Exception e){
            e.printStackTrace();
        }
        return rs;
    }

}
